package dao.impl;

import dao.mapper.BeansMapper;
import wrap.WrapBeans;
import dao.BeansDAO;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

public class BeansDAOImpl implements BeansDAO {
    private BeansMapper mapper;

    public BeansDAOImpl(SqlSessionFactory factory) {
        mapper = factory.openSession().getMapper(BeansMapper.class);
    }

    @Override
    public WrapBeans a(int f6) {
        WrapBeans list;
        try {
            list = mapper.a(f6);
        } catch (Exception e) {
            list = null;
            e.printStackTrace();
        }
        return list;
    }

    @Override
    public List<WrapBeans> b(int f1) {
        List<WrapBeans> list;
        try {
            list = mapper.b(f1);
        } catch (Exception e) {
            list = null;
            e.printStackTrace();
        }
        return list;
    }

    @Override
    public List<WrapBeans> c() {
        List<WrapBeans> list;
        try {
            list = mapper.c();
        } catch (Exception e) {
            list = null;
            e.printStackTrace();
        }
        return list;
    }
}
